-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
ALTER PROCEDURE PRO_KEYWORD 
	-- Add the parameters for the stored procedure here
	@AuthorName VARCHAR(255),
	@InsititutionName VARCHAR(255),
	@Frequency VARCHAR(255),
	@Year VARCHAR(255)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	SELECT * FROM BAS_KEYWORD WHERE 
		TOTALCOUNT > @Frequency 
		AND ARTICLE_ID IN (SELECT ARTICLE_ID FROM BAS_ARTICLE WHERE PUBLISHDATE LIKE '%' + @Year + '%')
		AND ARTICLE_ID IN (SELECT ARTICLE_ID FROM BAS_AUTHOR WHERE NAME LIKE '%' + @AuthorName + '%')
		AND ARTICLE_ID IN (SELECT ARTICLE_ID FROM BAS_INSTITUTION WHERE NAME LIKE '%' + @InsititutionName + '%') 
END
GO